<?php
namespace User\Controller;
use Think\Controller;

class CkController extends Controller
{  
   protected $userinfo; //会员信息

   //检查登陆状态
   public function _initialize()
   { 
    //echo __ACTION__;
    //文章模块不检查是否登陆
    if(__ACTION__!=="/User/Article/show" && __ACTION__!=="/User/Help/index" && __ACTION__!=="/User/Shop/buy" && __ACTION__!=="/User/Shop/buy_do" && __ACTION__!=="/User/Invited/index"){
     //session读取
     $SESSION=session("user");
     if(empty($SESSION['id']))
      {  
         $uid=I('get.uid')?I('get.uid'):0;
         if($uid){
           $this->redirect(U('/User/reg/'.$uid));
         } 
       
         $this->redirect('/User/login');
      }else{ 
         $_user['id']=de_crypt($SESSION['id']);
         $_user=M("user")->where($_user)->field("id,balance,xiaji,dongjie,paid,fans1,fans2,fans3,fans4,fans5,alipay,alipayname,login_time,reg_time,user_tel")->find();
         //如果微信登陆
         if(empty($_user['user_tel']) && C("WEIXIN_REG_TEL")){
          if(($_user['login_time']-$_user['reg_time']) > 100){
               $this->display("/tel");
               die();
           }
         }
         $this->userinfo= $_user;
         if(empty($_user)){ 
              session('user',null);
              $this->error("非法注入session!");
         }
      }
    }
      //Rbac权限检查
      
      //检查微信登陆用户
      

 

   }




 


}